﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Reflection;
using System.ComponentModel;

namespace MediaRecommender.Model
{
    public static class EnumExtensions
    {
        public static string GetDescription(this Enum value)
        {
            FieldInfo fi = value.GetType().GetField(value.ToString());

            DescriptionAttribute[] attributes =
                (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);

            if (attributes != null && attributes.Length > 0)
                return attributes[0].Description;
            else
                return value.ToString();
        }
    }

    public enum Sex
    {
        #region Sex
        Male,
        Female
        #endregion
    }

    public enum Genre
    {
        #region Genre
        Comedy,
        Romance,
        [DescriptionAttribute("Science Fiction")]
        ScienceFiction,
        Action,
        Short,
        Holiday,
        Kids,
        Music,
        RoadMovie,
        Disaster,
        Suspense,
        SportsFilm,
        Erotic,
        FilmNoir,
        Neonoir,
        TVmovie,
        Sport,
        Foreign,
        Eastern,
        History,
        Indie,
        Thriller,
        Horror,
        Drama,
        Adventure,
        Fantasy,
        Crime,
        Historical,
        Animation,
        Documentary,
        Western,
        War,
        Biography,
        Family,
        Musical,
        Mystery
        #endregion
    }

    public enum Platform
    {
        #region Platform
        PC, 
        [DescriptionAttribute("PlayStation 4")]
        PS4, 
        [DescriptionAttribute("XBox One")] 
        XBox1, 
        [DescriptionAttribute("Nintendo Wii U")] 
        WiiU,
        [DescriptionAttribute("PlayStation 3")]
        PS3,
        [DescriptionAttribute("XBox 360")]
        XBox360, 
        [DescriptionAttribute("Nintendo Wii")] 
        Wii,
        [DescriptionAttribute("PlayStation 2")]
        PS2, 
        XBox,
        [DescriptionAttribute("Nintendo GameCube")]
        GameCube
        #endregion
    }
}